Systems and methods for conditional generative models

ABSTRACT

Systems and methods for training a conditional generator model are described. Methods receive a sample, and determine a discriminator loss for the received sample. The discriminator loss is based on an ability to determine whether the sample is generated by the conditional generator model or is a ground truth sample. The method determines a secondary loss for the generated sample and updates the conditional generator model based on an aggregate of the discriminator loss and the secondary loss.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present invention claims priority to U.S. Provisional Patent Application Ser. No. 62/686,472 entitled “Generative adversarial network”, filed Jun. 18, 2018. The disclosure of U.S. Provisional Patent Application Ser. No. 62/686,472 is herein incorporated by reference in its entirety.

FIELD OF THE INVENTION

The present invention generally relates to generative adversarial networks and more specifically relates to novel and inventive methods for training conditional generative adversarial networks.

BACKGROUND

Deep learning influences almost every aspect of the machine learning and artificial intelligence. It gives superior results for classification and regression problems compared to classical machine learning approaches. Deep learning can also have significant impacts on generative models. One of the most interesting challenges in artificial intelligence is in training conditional generative models (or generators) which are able to provide labeled adversarial samples drawn from a specific distribution. Conditional generative models are models which can generate a class-specific sample given the right latent input. As one example, these generators can learn the data distribution for male/female faces and produce outputs that match a single (male/female) class.

SUMMARY OF THE INVENTION

Systems and methods for training a conditional generator model in accordance with embodiments of the invention are described. One embodiment includes a method that receives a sample, and determines a discriminator loss for the received sample. The discriminator loss is based on an ability to determine whether the sample is generated by the conditional generator model or is a ground truth sample. The method determines a secondary loss for the generated sample and updates the conditional generator model based on an aggregate of the discriminator loss and the secondary loss.

In a further embodiment, the steps of receiving, determining a discriminator loss, determining a secondary loss, and updating the conditional generator model are performed iteratively.

In still another embodiment, determining the secondary loss for a first iteration is performed using a first secondary loss model and determining the secondary loss for a second iteration is performed using a different second secondary loss model.

In a still further embodiment, the sample comprises an associated label and wherein determining the secondary loss comprises using a classification model trained to classify the sample into one of a plurality of classes.

In another embodiment, the classification model is a pre-trained model that is not modified during the training of the conditional generator model.

In yet another embodiment, determining the secondary loss comprises using a regression model trained to predict a continuous aspect of the sample.

In a yet further embodiment, determining the secondary loss comprises determining a plurality of secondary losses using a plurality of different secondary models.

In another additional embodiment, the aggregate is a weighted average of the discriminator loss and the secondary loss.

In a further additional embodiment, the steps of receiving, determining a discriminator loss, determining a secondary loss, and updating the conditional generator model are performed iteratively, wherein a weight used for calculating the weighted average is different between different iterations.

In another embodiment again, the method further generates a set of outputs using the trained conditional generator model. The set of outputs includes a set of samples and a set of associated output labels. The method trains a new model using the set of generated outputs that does not include any samples.

Additional embodiments and features are set forth in part the description follows, or may be learned by the practice of the invention. A further understanding of the nature and advantages of the present invention may be realized by reference to the remaining portions of the specification and the drawings, which forms a part of this disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawing(s) will be provided by the Office upon request and payment of the necessary fee.

The description and claims will be more fully understood with reference to the following figures and data graphs, which are presented as exemplary embodiments of the invention and should not be construed as a complete recitation of the scope of the invention.

FIG. 1 illustrates an example of a system for training a conditional generative model.

FIG. 2 conceptually illustrates an example of a process for training a conditional generative model.

FIG. 3 conceptually illustrates an example of a process for training a conditional generative model.

FIG. 4 conceptually illustrates an example of a process for training a conditional generative model.

FIG. 5 illustrates sample outputs for a process that implements a binary classifier in accordance with an embodiment of the invention.

FIG. 6 illustrates the measured diversity measurements for a binary classifier for the sample outputs.

FIG. 7 illustrates the measured image quality measurements for a binary classifier for the sample outputs.

FIG. 8 conceptually illustrates an example of a process for training a conditional generative model.

FIG. 9 conceptually illustrates an example of a process for training a conditional generative model.

FIG. 10 illustrates sample outputs for a process that implements a regression model for secondary loss in accordance with an embodiment of the invention.

DETAILED DESCRIPTION

Turning now to the drawings, systems and methods for training a conditional generative model and for generating conditional outputs are described below. In many embodiments, conditional generative models comprise a generator, a discriminator, and a secondary loss model. Generators and discriminators can be adversarially trained to generate outputs that approximate a “true” data set. Discriminators can be a binary classifier that determines whether a sample is generated or is a genuine sample coming from a database. Discriminators in accordance with some embodiments of the invention can be autoencoders. In a number of embodiments, generators can include a deep neural network which accepts a vector from a latent space (e.g., uniformly distributed noise) and outputs a sample of the same type as the true data set.

In a variety of embodiments, secondary loss models can be used to provide additional feedback for training a generator to be able to generate specific outputs. Secondary loss models in accordance with many embodiments of the invention can include, but are not limited to, classifiers and regressive models. In several embodiments, systems and methods train a deep conditional generator by placing a classifier in parallel with the discriminator and back propagate the classification error through the generator network. In some embodiments, secondary errors (e.g., classification error, regression error, etc.) are aggregated with a discriminator error and back propagated through a generator model. Systems and methods in accordance with a variety of embodiments of the invention can train a discriminator and a secondary loss model to generate separate losses, which can be combined to train a generator to generate conditional outputs. The method is versatile and is applicable to many variations of generative adversarial network (GAN) implementations, and also gives superior results compared to similar methods.

Conditional Generation System

A system that provides for training a conditional generative model and for generating conditional outputs in accordance with some embodiments of the invention is shown in FIG. 1 . Network 100 includes a communications network 160. The communications network 160 is a network such as the Internet that allows devices connected to the network 160 to communicate with other connected devices.

Server systems 110, 140, and 170 are connected to the network 160. Each of the server systems 110, 140, and 170 is a group of one or more servers communicatively connected to one another via internal networks that execute processes that provide cloud services to users over the network 160. For purposes of this discussion, cloud services are one or more applications that are executed by one or more server systems to provide data and/or executable applications to devices over a network. The server systems 110, 140, and 170 are shown each having three servers in the internal network. However, the server systems 110, 140 and 170 may include any number of servers and any additional number of server systems may be connected to the network 160 to provide cloud services. In accordance with various embodiments of this invention, a network that uses systems and methods that train and apply conditional generative models in accordance with an embodiment of the invention may be provided by a process (or a set of processes) being executed on a single server system and/or a group of server systems communicating over network 160.

Users may use personal devices 180 and 120 that connect to the network 160 to perform processes for providing and/or interacting with a network that uses systems and methods that train and apply conditional generative models in accordance with various embodiments of the invention. In the shown embodiment, the personal devices 180 are shown as desktop computers that are connected via a conventional wired connection to the network 160. However, the personal device 180 may be a desktop computer, a laptop computer, a smart television, an entertainment gaming console, or any other device that connects to the network 160 via a wired connection. The mobile device 120 connects to network 160 using a wireless connection. A wireless connection is a connection that uses Radio Frequency (RF) signals. Infrared signals, or any other form of wireless signaling to connect to the network 160. In FIG. 1 , the mobile device 120 is a mobile telephone. However, mobile device 120 may be a mobile phone, Personal Digital Assistant (PDA), a tablet, a smartphone or any other type of device that connects to network 160 via wireless connection without departing from this invention.

Conditional Generation Element

A conditional generation element for training a conditional generative model in accordance with a number of embodiments is illustrated in FIG. 2 . In various embodiments, conditional generation element 200 is one or more of a server system and/or personal devices within a networked system similar to the system described with reference to FIG. 1 . Conditional generation element 200 includes a processor (or set of processors) 205, network interface 210, and memory 220. The network interface 205 is capable of sending and receiving data across a network over a network connection. In a number of embodiments, the network interface 205 is in communication with the memory 220. In several embodiments, memory 220 is any form of storage configured to store a variety of data, including, but not limited to, a conditional generation application 225, training data 230, and model data 235. Conditional generation application 225 in accordance with some embodiments of the invention directs the processor 205 to perform a variety of processes, such as (but not limited to) using data from training data 230 to update model parameters 235 in order train and utilize generative models to generate conditional outputs. In some embodiments, training data can include “true” data, which a conditional generator is being trained to imitate. For example, true data can include examples of human faces, which can be used to train a generator to generate new samples of human faces. Model data or parameters can include data for generator models, discriminator models, and/or secondary models.

Although a specific example of a conditional generation element is illustrated in FIG. 2, any of a variety of secure conditional generation elements can be utilized to perform processes similar to those described herein as appropriate to the requirements of specific applications in accordance with embodiments of the invention.

Conditional Generation Application

A conditional generation application in accordance with a number of embodiments of the invention is illustrated in FIG. 3 . In this example, conditional generation element 300 includes a generator engine 305, discriminator engine 310, secondary loss engine 315, database 320, error computation engine 325 and a model trainer 330. In this example, generator engine 305 generates sample outputs. Sample outputs and true samples from database 320 can be used to train discriminator engine 310. Secondary loss engine 315 can be trained on true samples from database 320 in accordance with a number of embodiments of the invention. Model trainer 330 trains generator engine 305 based on an aggregate error computed by error computation engine 325 from secondary loss engine 315 and discriminator engine 310. Conditional generation applications in accordance with many embodiments of the invention process data to train stochastic models that can be used to model complex probability distributions.

Generator engine 305 is a conditional generator that can be trained to generate specific types of outputs. Generator engines in accordance with various embodiments of the invention can include (but are not limited to) decoders and deconvolutional neural networks. Generator engines in accordance with many embodiments of the invention can take random samples as inputs to generate outputs similar true samples, or to match a target distribution. In many embodiments, generator engines receive a random set of inputs, along with a specified class or a continuous aspect, in order to generate an output of the specified class or with the specified continuous aspect.

Discriminator engine 310 can be used to determine whether an input (or sample) is from a target distribution, or whether it is a generated output of a generator model. Adversarial training of discriminator engines and generator engines can simultaneously train a generator to produce more realistic outputs while also training a discriminator to more effectively distinguish between generated and true inputs.

Secondary loss engine 315 can be used to refine a generator engine, such that the generator engine not only generates outputs that are similar to the target distribution, but are able to generate specific types of outputs within the target distribution. For example, a target distribution may include human faces, while a secondary loss engine may include a classifier to classify human faces as male or female. Secondary loss engines in accordance with several embodiments of the invention can include one or more models, including (but not limited to) binary classifiers, multi-class classifiers, and/or regression models. In some embodiments, secondary loss engines are pre-trained models that trained on a large corpus of training data to classify into a number of different classes. The loss from a secondary loss engine can then be used to train a generator to generate better samples of a specific class or distribution within the target population.

Error computation engine 325 can be used to compute an aggregate loss for the conditional generation application. In many embodiments, aggregate losses are a combination of a discriminator loss and one or more secondary losses from one or more secondary models. Aggregate losses in accordance with certain embodiments of the invention use a weighted combination of the discriminator and secondary loss to control the effects of each model on the training of a generator model. In some embodiments, error computation engines can change the weightings of the different losses between different epochs of training (e.g., in an alternating fashion), allowing the model to emphasize different aspects of the training in different epochs.

Although a specific example of a conditional generation application is illustrated in FIG. 3 , any of a variety of secure conditional generation applications can be utilized to perform processes similar to those described herein as appropriate to the requirements of specific applications in accordance with embodiments of the invention.

Training Process

When training a conditional generative model, other solutions are often not versatile enough to be applied to different GAN variations. In some embodiments, processes can mix losses from a discriminator and a secondary model to train a generator. However, mixing the loss of discriminator and the classifier can alter the training convergence, especially if the output of the discriminator is from a different type compare to the classifier's output. For example, in certain cases, outputs from a discriminator include an image (2D matrix), while outputs of a classifier include a (1D) vector. Merging the losses for output types into a single loss can alter the convergence of the network. Systems and methods for training a conditional generator model in accordance with a number of embodiments of the invention are independent of the generator and discriminator structure, i.e., the presented method can be applied to any model that is already converging. By separating the secondary term into a separate secondary model, the secondary loss can be separated from the discriminator's loss function, facilitating the discriminator's ability converge.

An example of a process for training a conditional generator model is conceptually illustrated in FIG. 4 . Process 400 receives (405) an input sample. Input samples can include ground truth samples and/or generated samples of various types including (but not limited to) images, video, text, audio, and 3D meshes. Process 400 determines (410) a discriminator loss. Determining a discriminator loss in accordance with some embodiments of the invention can include running an input sample through a binary classifier model that is trained to predict whether an input sample is a generated sample or a ground truth sample, where the output of the binary classifier model is based on the accuracy of the classifier model's prediction.

Process 400 determines (415) a secondary loss based on a secondary model. Secondary models can be pre-trained on a large corpus of inputs to compute an output (such as, but not limited to, a classification, predicted value, etc.). Secondary losses in accordance with many embodiments of the invention can be computed to determine the accuracy of the secondary model's outputs versus the expected output. In some embodiments, secondary losses can reflect a secondary model's accuracy and/or confidence in labeling an input correctly.

Process 400 computes (420) an aggregate error. Aggregate errors in accordance with some embodiments of the invention can include weighted averages of a discriminator loss and one or more secondary losses. In certain embodiments, aggregate errors can weight different losses based on a variety of factors including (but not limited to) a relative size of each loss, a desired effect for the discriminator and/or the secondary loss model, etc. In some embodiments, computation engines can change the weightings of the different losses between different epochs of training (e.g., in an alter gating fashion), allowing the model to emphasize different aspects of the training in different epochs.

Process 400 updates (425) the generator model based on the computed aggregate error. In many embodiments, computed aggregate errors are back propagated through the generator model, allowing the generator to update the weights of the model to not only generate more realistic (or true) samples, but also to be able to generate specific types or classes of samples. Processes for training a conditional generator model in accordance with a variety of embodiments of the invention can be performed iteratively while the model converges. The process 400 then ends.

Although a specific example of a process for training a conditional generator is illustrated in FIG. 4 , any of a variety processes including (but not limited to) processes that utilize additional steps, fewer steps, and/or that perform the steps in a different order, can be utilized as appropriate to the requirements of specific applications in accordance with embodiments of the invention.

Secondary Loss

In many embodiments, secondary losses can include losses for any of a variety of models that can be used to refine the outputs of a generator. Secondary losses can include (but are not limited to) losses for binary classifiers, multi-class classifiers, and/or regressors. Similar methods can be applied to any GAN framework regardless of the model structures and/or loss functions. In a number of embodiments, different secondary loss models can be used for different iterations. Secondary loss models in accordance with some embodiments of the invention can include multiple different secondary loss models. Details regarding examples of different secondary structures are also described below.

Binary Classifier

In a number of embodiments, secondary losses for two-class problems are investigated. In some embodiments, classifiers can include a binary classifier with binary cross-entropy loss function.

Binary classifier The notations used in below are as follows:

-   -   1. V(G,D): is the objective function for a general generative         model, wherein G and D are Generator and Discriminator.     -   2. The latent space Z is partitioned into Z₁, Z₂ subsets. This         means that Z₁ and Z₂ are disjoint and their union is equal to         the Z-space.     -   3. C is the classifier function.     -   4.         _(ce) is the binary cross-entropy loss function.

For a fixed Generator and Discriminator, the optimal Classifier is

$\begin{matrix} {C_{G,D}^{*} = \frac{p_{X_{1}}(x)}{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}}} & (1) \end{matrix}$ wherein C_(G,D)* is the optimal classifier, and p_(X) ₁ (x), and p_(X) ₂ (x) are the distributions of generated samples for the first and second class respectively.

The objective function for the model is given by: O(G,D,C)=V(G,D)+

_(ce)(C)  (2) This can be rewritten as O(G,D,C)=V(G,D)−

_(z˜pZ) ₁ _((z))[log(C(G(z)))]−

_(z˜pZ) ₂ _((z))[log(1−C(G(z)))]  (3) which is given by O(G,D,C)=V(G,D)−{∫p _(Z) ₁ (z)log(C(G(z)))+p _(Z) ₂ (z)log(1−C(G(z)))dz}  (4) Considering G(z₁)=x₁ and G(z₂)=x₂, O(G,D,C)=V(G,D)−{∫p _(X) ₁ (x)log(C(x))+p _(X) ₂ (x)log(1−C(x))dx}  (5)

The function ƒ →m log(ƒ)+n log(1−ƒ) reaches its maximum at

$\frac{m}{m + n}$ for any (m,n) ∈

²\{0,0}.

The maximum value for

_(ce)(C) is log(4) and is achieved if and only if p_(X) ₁ =p_(X) ₂ . For p_(X) ₁ =p_(X) ₂ ⇒C_(G,D)*=½ and by observing that −

_(ce)(C)=

_(x˜pX) ₁ _((x))(log(C(x)))+

_(x˜pX) ₂ _((x))(log(1−C(x)))  (6) results in

_(ce)(C _(G,D)*)=−log(½)−log(½)=log(4)  (7) To show that this is the maximum value, from equation 5,

$\begin{matrix} {{\mathcal{L}_{ce}\left( C_{G,D}^{*} \right)} = {{- {\int{{p_{X_{1}}(x)}{\log\left( \frac{p_{X_{1}}(x)}{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}} \right)}{dx}}}} - {\int{{p_{X_{2}}(x)}{\log\left( \frac{p_{X_{2}}(x)}{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}} \right)}{dx}}}}} & (8) \end{matrix}$ which is equal to

$\begin{matrix} {{\mathcal{L}_{ce}\left( C_{G,D}^{*} \right)} = {{\log(4)} - {\int{{p_{X_{1}}(x)}{\log\left( \frac{p_{X_{1}}(x)}{\frac{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}}{2}} \right)}{dx}}} - {\int{{p_{X_{2}}(x)}{\log\left( \frac{p_{X_{2}}(x)}{\frac{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}}{2}} \right)}{dx}}}}} & (9) \end{matrix}$ results in

$\begin{matrix} {{\mathcal{L}_{ce}\left( C_{G,D}^{*} \right)} = {{\log(4)} - {{KL}\left( {{p_{X_{1}}(x)}{}\frac{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}}{2}} \right)} - {{KL}\left( {{p_{X_{2}}(x)}{}\frac{{p_{X_{1}}(x)} + {p_{X_{2}}(x)}}{2}} \right)}}} & (10) \end{matrix}$ Where K is the Kullback-Leibler divergence, which is always positive or equal to zero.

Minimizing the binary cross-entropy loss function

_(ce) for the classifier C is increasing the Jensen-Shannon divergence between p_(X) ₁ and p_(X) ₂ , the Jensen-Shannon divergence between p₁ and p₂ is given by

$\begin{matrix} {{{JSD}\left( {p_{1}{}p_{2}} \right)} = {{\frac{1}{2}{{KL}\left( {p_{1}{}\frac{p_{1} + p_{2}}{2}} \right)}} + {\frac{1}{2}{{KL}\left( {p_{2}{}\frac{p_{1} + p_{2}}{2}} \right)}}}} & (11) \end{matrix}$ considering equation 10 and 11, it gives

_(ce)(C _(G,D)*)=log(4)−2JSD(p _(X) ₁ ∥p _(X) ₂ )  (12) minimizing

_(ce) is equal to maximizing JSD(P_(X) ₁ ∥p_(X) ₂ ).

As shown, placing the classifier C and adding its loss value the generative framework in accordance with a number of embodiments of the invention can push the generator to increase the distance of samples that are drawn from a specific class with respect to the other class. Processes in accordance with many embodiments of the invention can increase the Jensen Shannon Divergence (JSD) between classes generated by the deep generator so that the generator can produce samples drawn from a desired class. For example, in the male/female face scenario, a partition of Z space can be used to generate male and another partition to generate female samples.

Multi-Class Classifier

In a number of embodiments, secondary losses for multi-class problems are investigated. In such cases, the classifier can be a multiple class classifier with a categorical cross-entropy loss function.

The terms used below are as follows:

-   -   1. N is the number of the classes.     -   2. The latent space Z is partitioned in to {Z₁, Z₂, . . . ,         Z_(N)} subsets. This means that {Z₁, Z₂, . . . , Z_(N)} are         disjoint and their union is equal to the Z-space.     -   3. C is the classifier function.     -   4.         _(ce) is the binary cross-entropy loss function.     -   5.         _(cce) is the categorical cross-entropy loss function.

In the multiple classes case, the classifier C has N outputs, where N is the number of the classes. In this approach, each output of the classifier can correspond to one class. For a fixed Generator and Discriminator, the optimal output for class c (c′th output) is:

$\begin{matrix} {{C_{G,D}^{*}(c)} = \frac{p_{X_{c}}(x)}{\sum_{i = 1}^{N}{p_{X_{i}}(x)}}} & (13) \end{matrix}$

Considering just one of the outputs of the classifier, the categorical cross-entropy can be reduced to binary cross-entropy given by

_(ce)(C(c))=−

_(z˜pZ) _(c) (z)[log(C(G(z))]−

_(z˜Σ) _(i≠c) _(pZ) _(i) _((z))[1−log(C(G(z)))]  (14) which is equal to

$\begin{matrix} {{\mathcal{L}_{ce}\left( {C(c)} \right)} = {{\int{{p_{Z_{c}}(z)}{\log\left( {C\left( {G(z)} \right)} \right)}}} + {\left( {\sum\limits_{i \neq c}{p_{Z_{i}}(z)}} \right){\log\left( {1 - {{C\left( {G(z)} \right)}{dz}}} \right)}}}} & (15) \end{matrix}$

By considering G(z_(i))=x_(i),

$\begin{matrix} {{\mathcal{L}_{ce}\left( {C(c)} \right)} = {{\int{{p_{Z_{c}}(z)}{\log\left( {C\left( {G(z)} \right)} \right)}}} + {\left( {\sum\limits_{i \neq c}{p_{Z_{i}}(z)}} \right){\log\left( {1 - {{C\left( {G(z)} \right)}{dz}}} \right)}}}} & (16) \end{matrix}$

The function ƒ→ m log(ƒ)+n log(1−ƒ) gets its maximum at

$\frac{m}{m + n}$ for (m,n) ∈

²\ {0,0}. The maximum value for

_(cce)(C) is N log(N) and is achieved if and only if p_(X) ₁ =p_(X) ₂ = . . . =p_(X) _(N) . The categorical cross-entropy is given by

$\begin{matrix} \begin{matrix} {\mathcal{L}_{cce} = {- {\sum\limits_{i = 1}^{N}{{{\mathbb{E}}_{z\sim p_{Z_{i}}}(z)}\left\lbrack {\log\left( {C\left( {G(z)} \right)} \right)} \right\rbrack}}}} \\ {= {- {\sum\limits_{i = 1}^{N}{\int{{p_{X_{i}}(x)}{\log\left( {C(x)} \right)}{dx}}}}}} \end{matrix} & (17) \end{matrix}$

From equation 13,

$\begin{matrix} \begin{matrix} {\mathcal{L}_{cce} = {- {\sum\limits_{i = 1}^{N}\left( {\int{{p_{X_{i}}(x)}{\log\left( \frac{p_{X_{i}}(x)}{\sum_{j = 1}^{N}{p_{j}(x)}} \right)}{dx}}} \right)}}} \\ {= {{- {\sum\limits_{i = 1}^{N}\left( {\int{{p_{X_{i}}(x)}{\log\left( \frac{p_{X_{i}}(x)}{\sum_{j = 1}^{N}\frac{p_{j}(x)}{N}} \right)}{dx}}} \right)}} + {N\;{\log(N)}}}} \\ {= {{N\;{\log(N)}} - {\sum\limits_{i = 1}^{N}{{KL}\left( {{p_{X_{i}}(x)}{}{\sum\limits_{j = 1}^{N}\frac{p_{X_{j}}(x)}{N}}} \right)}}}} \end{matrix} & (18) \end{matrix}$ where KL is the Kullback-Leibler divergence, which is always positive or equal to zero.

Now consider p_(X) ₁ =p_(X) ₂ = . . . =p_(X) _(N) . From equation 18,

$\begin{matrix} \begin{matrix} {\mathcal{L}_{cce} = {{N\;{\log(N)}} - {\sum\limits_{i = 1}^{N}{{KL}\left( {{p_{X_{i}}(x)}{}{p_{X_{i}}(x)}} \right)}}}} \\ {= {N\;{\log(N)}}} \end{matrix} & (19) \end{matrix}$

It can be shown that minimizing L_(cce) increases the Jensen-Shannon Divergence between p_(X) ₁ , p_(X) ₂ , . . . p_(X) _(N) . From equation 18,

$\begin{matrix} {\mathcal{L}_{cce} = {{N\;{\log(N)}} - {\int{\sum\limits_{i = 1}^{N}{\left( {{p_{X_{i}}(x)}\left\lbrack {{\log\left( {p_{X_{i}}(x)} \right)} - {\log\left( {\sum\limits_{j = 1}^{N}\frac{p_{X_{j}}(x)}{N}} \right)}} \right\rbrack} \right){dx}}}}}} & (20) \end{matrix}$ which can be rewritten as

$\begin{matrix} {\mathcal{L}_{cce} = {{N\;{\log(N)}} - {\sum\limits_{i = 1}^{N}\left( {\int{{p_{X_{i}}(x)}{\log\left( {p_{X_{i}}(x)} \right)}{dx}}} \right)} + \underset{\underset{{({\overset{N}{\underset{i = 1}{\Sigma}}{p_{X_{i}}{(x)}}})}{({\log({\underset{j = 1}{\overset{N}{\Sigma}}\;\frac{p_{X_{j}}{(x)}}{N}})})}}{︸}}{\int{\sum\limits_{i = 1}^{N}{\left( {{p_{X_{i}}(x)}{\log\left( {\sum\limits_{j = 1}^{N}\frac{p_{X_{j}}(x)}{N}} \right)}} \right){dx}}}}}} & (21) \end{matrix}$ which is equal to

$\begin{matrix} {\mathcal{L}_{cce} = {{N\;\log\;(N)} - {N{\sum\limits_{i = 1}^{N}\left( {\frac{1}{N}{\int{{p_{X_{i}}(x)}{\log\left( {p_{X_{i}}(x)} \right)}{dx}}}} \right)}} + {N{\int{\left( {\sum\limits_{i = 1}^{N}\frac{p_{X_{i}}(x)}{N}} \right)\left( {\log\left( {\sum\limits_{j = 1}^{N}\frac{p_{X_{j}}(x)}{N}} \right)} \right){dx}}}}}} & (22) \end{matrix}$

This equation can be rewritten as

$\begin{matrix} {\mathcal{L}_{cce} = {{N\;{\log(N)}} - \left\lbrack {{H\left( {\sum\limits_{i = 1}^{N}{\frac{1}{N}{p_{X_{i}}(x)}}} \right)} - {\sum\limits_{i = 1}^{N}{\frac{1}{N}{H\left( {p_{X_{i}}(x)} \right)}}}} \right\rbrack}} & (23) \end{matrix}$ wherein the H(p) is the Shannon entropy of the distribution p. The Jensen Shannon divergence between N distributions p_(X) ₁ , P_(X) ₂ , . . . p_(X) _(N) , is defined as

$\begin{matrix} {{{JSD}_{\pi_{1},\pi_{2},\ldots,\pi_{N}}\left( {p_{1},p_{2},\ldots\mspace{11mu},\; p_{N}} \right)} = {{H\left( {\sum\limits_{i = 1}^{N}{\pi_{i}p_{i}}} \right)} - {\sum\limits_{i = 1}^{N}{\pi_{i}{H\left( p_{i} \right)}}}}} & (24) \end{matrix}$

From equations 23 and 24,

$\begin{matrix} {\mathcal{L}_{cce} = {{N\;{\log(N)}} - {{NJSD}_{\frac{1}{N},\frac{1}{N},\ldots,\frac{1}{N}}\left( {{p_{X_{1}}(x)},{p_{X_{2}}(x)},\ldots\mspace{11mu},{p_{X_{N}}(x)}} \right)}}} & (25) \end{matrix}$ Accordingly, minimizing L_(cce) increases the JSD term.

Regressor

In some embodiments secondary losses can include losses for a regression network. A new loss function in accordance with a variety of embodiments of the invention can be used in conjunction with a regression network. In numerous embodiments, the regression error can be back-propagated through the generator, allowing the generator to be trained while constraining the generated samples to any continuous aspect of the original database. For example in a face generation application, given the right latent sequence, a generator can be trained to create faces with particular landmarks.

The following loss function is introduced for the regression network. L _(R) =∫∫dp _(z)(z)(−log(1−(y−R(G(z)))))dz  (26) wherein z is the latent space variable dp_(z)(z) is the distribution of an infinitesimal partition of latent space, y is the target variable (ground truth), R is the regression function and G is the generator function. For the loss function in equation 26 the optimal regressor is

$\begin{matrix} {R^{*} = {\frac{p(x)}{c} + y - 1}} & (27) \end{matrix}$ wherein p(x) is the distribution of the generator's output, c is post-integration constant, and y is the target function.

Considering the inner integration of equation 26 and by replacing G (z)=x, the extremum of the loss function with respect to R is

$\begin{matrix} {{\frac{d}{dR}{\int{{{dp}_{x}(x)}\left( {- {\log\left( {1 - \left( {y - {R(x)}} \right)} \right)}} \right){dx}}}} = 0} & (28) \end{matrix}$ which can be written as

$\begin{matrix} {{\int\frac{- {dp}_{x}}{R - y + 1}} = {\left. 0\Rightarrow\frac{p_{x}}{R - y + 1} \right. = c}} & (29) \end{matrix}$ this results in

$\begin{matrix} {R = {\frac{p(x)}{c} + y - 1}} & (30) \end{matrix}$

Minimizing the loss function in equation 26 decreases the entropy of the generator's output. By replacing equation 27 in 26,

$\begin{matrix} {L_{R} = {\int{\int{{- {\log\left( \frac{p_{x}(x)}{c} \right)}}{dp}_{x}{dx}}}}} & (31) \end{matrix}$ which can be rewritten as L _(R) =−∫p _(x)(x)log(p _(x)(x))dx+log(c)=H(p _(x)(x))+log(c)  (32) wherein H is the Shannon entropy. Minimizing L_(R) results in decreasing H(p_(x)(x)).

Adding the regressor to the model decreases the entropy of the generated samples. This is expectable since the idea is to constrain the output of the generator to obey some particular criteria. For any two sets of samples and their corresponding targets (y1 and y2), the loss function in equation 1 increases the Jensen Shannon Divergence (JSD) between generated samples for these two sets. Consider z1 and z2 are two partitions of the latent space correspond to two sets of samples with targets y1 and y2. In this case, the loss function in equation 26 is given by:

$\begin{matrix} {L_{R} = {{- {\int{{p_{z_{1}}(z)}{\log\left( {1 - \left( {y_{1} - {R\left( {G\left( z_{1} \right)} \right)}} \right)} \right)}d\; z}}} - {\int{{p_{z_{2}}(z)}{\log\left( {1 - \left( {y_{2} - {R\left( {G\left( z_{2} \right)} \right)}} \right)} \right)}d\; z}}}} & (33) \end{matrix}$

Considering G(z1)=x₁,G(z2)=x₂, c₁=1−y₁ and c₂=1−y₂ equation 33 simplifies to L _(R) =−∫p _(x) ₁ (x)log(c ₁ +R(x))dx−∫p _(x) ₂ (x)log(c ₂ +R(x))dx  (34) To find the optimum R(x) the derivative of the integrand is set to zero given by

$\begin{matrix} {{\frac{p_{x_{1}}}{c_{1} + R} + \frac{p_{x_{2}}}{c_{2} + R}} = 0} & (35) \end{matrix}$ which results in

$\begin{matrix} {R = {- \frac{{p_{x_{1}}c_{2}} + {p_{x_{2}}c_{1}}}{p_{x_{1}} + p_{x_{2}}}}} & (36) \end{matrix}$ By replacing equation 36 in equation 34 it simplifies to

$\begin{matrix} {L_{R} = {{- {\int{p_{x_{1}}{\log\left( \frac{\left( {c_{1} - c_{2}} \right)p_{x_{1}}}{p_{x_{1}} + p_{x_{2}}} \right)}}}} - {\int{p_{x_{2}}{\log\left( \frac{\left( {c_{2} - c_{1}} \right)p_{x_{2}}}{p_{x_{1}} + p_{x_{2}}} \right)}{dx}}}}} & (37) \end{matrix}$ which can be rewritten as

$\begin{matrix} {R_{L} = {{- {\int{\log\left( \frac{p_{x_{1}}}{\frac{p_{x_{1}} + p_{x_{2}}}{2}} \right)}}} - {\int{\log\left( \frac{p_{x_{2}}}{\frac{p_{x_{1}} + p_{x_{2}}}{2}} \right)}} - {\log\left( {c_{1} - c_{2}} \right)} - {\log\left( {c_{2} - c_{1}} \right)} - {\log(4)}}} & (38) \end{matrix}$ which equals to R _(L)=−log(c ₁ −c ₂)−log(c ₂ −c ₁)−log(4)−2JSD(p _(x) ₁ ∥p _(x) ₂ )  (39) minimizing R_(L), increasing JSD(p_(x) ₁ ∥p_(x) ₂ ) term. In this section, it has been shown that the presented loss function increases the distance between generated samples for any two set of aspects, which can be desirable.

Although specific examples of loss functions are described above, one skilled in the art will recognize that other loss functions can be utilized as appropriate to the requirements of specific applications in accordance with embodiments of the invention.

Example Outputs

Sample outputs for a process that implements a binary classifier in accordance with an embodiment of the invention are illustrated in FIG. 5 . Images 505 and 515 show generated images of female and male faces respectively using other methods known in the art. Images 510 and 520 show samples of generated female and male images using methods in accordance with various embodiments of the invention. As it is shown in these figures, the gender-specific generator fails to correctly generate samples for a specific class when the conditional GAN is applied. The samples generated using methods in accordance with embodiments of the invention can result in greater diversity and higher quality images that are better constrained to the different classes.

FIGS. 6 and 7 show various results of the different samples. In these charts, the different sets of bars represent:

-   -   1. Each male sample has been compared to all the other male         samples, and all the metrics have been calculated for these         comparisons, and the average of these numbers has been obtained         (first set of bars).     -   2. Each female sample has been compared all the other female         samples, and all the metrics have been calculated for these         comparisons, and the average of these numbers has been obtained         (second set of bars).     -   3. Each male samples has been compared to all female samples,         and all the metrics have been calculated for these comparisons,         and the average of these numbers has been obtained (third set of         bars).

FIG. 6 shows the measured diversity measurements for a binary classifier according to a number of different error metrics (or diversity metrics). Specifically, FIG. 6 compares mean squared error (MSE), root mean squared error (RMSE), and mean absolute error (MAE) for the different generation methods. The higher value of MSE, RMSE, and MAE shows the higher variation of the generated images.

FIG. 7 shows a comparison of different image quality metrics for the different methods. The lower value of universal quality index (UQI) and structural similarity index (SSIM) shows the lower levels of similarity between samples. In FIG. 7 , from the first two observations it is shown that the proposed method is able to generate samples in each class that are not similar. From the third observation, it is shown that the inter-class similarity in the proposed method is less than previously known methods, w here the generated samples from different classes are less similar to each other.

Sample outputs for a process that implements a multi-class model are illustrated in FIG. 8 . In this example, elements 805 were generated using an ACGAN method. Elements 810 were generated using methods in accordance with numerous embodiments of the invention. Classification accuracy for the different models are illustrated in the confusion matrices of FIG. 9 . The proposed method gives higher accuracy while also providing versatility, as it allows for the flexible use of any of a variety of different classifier networks.

Sample outputs for a process that implements a regression model for a secondary loss in accordance with an embodiment of the invention are illustrated in FIG. 10 . Images 1005 and 1015 show generated images of faces that are generated based on two different sets of landmarks using other methods known in the art. Images 1010 and 1020 show samples of generated faces using the same respective sets of landmarks using methods in accordance with various embodiments of the invention. As can be seen in these examples, the samples generated using methods in accordance with embodiments of the invention can result in higher quality images, and a greater diversity in the generated faces.

Outputs generated by a conditional generator in accordance with numerous embodiments of the invention can be used to train a new model. Generated outputs in accordance with some embodiments of the invention can include (but are not limited to) images, text, labels, and other forms of data. In numerous embodiments, the new model is trained solely on generated outputs, and does not include any data from a ground truth database of real images. By using such generated images, sensitive information from a ground truth database s, health information, etc.) can be protected and training dataset, while still allowing d to be trained on a realistic distribution of data.

Although the present invention has been described in certain specific aspects, many additional modifications and variations would be apparent to those skilled in the art. It is therefore to be understood that the present invention may be practiced otherwise than specifically described. Thus embodiments of the present invention should be considered in all respects as illustrative and not restrictive. 

What is claimed is:
 1. A method for training a conditional generator model, the method comprising: receiving a sample; determining a discriminator loss for the received sample, wherein the discriminator loss is based on an ability to determine whether the sample is generated by the conditional generator model or is a ground truth sample; determining a plurality of secondary losses for the generated sample using a binary classification model, a multi-class classification model and a regression model, wherein the binary classification model, the multi-class classification model and the regression model are within the conditional generator model; updating the conditional generator model based on an aggregate of the discriminator loss and the plurality of secondary losses; and generating images with one or more landmarks, wherein the generated images have higher diversity than the received sample.
 2. The method of claim 1, wherein the steps of receiving, determining a discriminator loss, determining a plurality of secondary losses, and updating the conditional generator model are performed iteratively.
 3. The method of claim 2, wherein determining the secondary loss for a first iteration is performed using a first secondary loss model and determining the secondary loss for a second iteration is performed using a different second secondary loss model.
 4. The method of claim 1, wherein the sample comprises an associated label and wherein the multi-class classification model is trained to classify the sample into one of a plurality of classes.
 5. The method of claim 4, wherein the classification model is a pre-trained model that is not modified during the training of the conditional generator model.
 6. The method of claim 1, wherein the regression model is trained to predict a continuous aspect of the sample.
 7. The method of claim 1, wherein the aggregate is a weighted average of the discriminator loss and the plurality of secondary losses.
 8. The method of claim 7, wherein the steps of receiving, determining a discriminator loss, determining a plurality of secondary losses, and updating the conditional generator model are performed iteratively, wherein a weight used for calculating the weighted average is different between different iterations.
 9. The method of claim 1 further comprising: generating a set of outputs using the trained conditional generator model, wherein the set of outputs comprises a set of samples and a set of associated output labels; and training a new model using the set of generated outputs that does not include any samples.
 10. A system comprising memory and one or more processors configured to: receive a sample; determine a discriminator loss for the received sample, wherein the discriminator loss is based on an ability to determine whether the sample is generated by a conditional generator model or is a ground truth sample; determine a plurality of secondary losses for the sample using a binary classification model, a multi-class classification model and a regression model, wherein the binary classification model, the multi-class classification model and the regression model are within the conditional generator model; update the conditional generator model based on an aggregate of the discriminator loss and the plurality of secondary losses; and generating images with one or more landmarks, wherein the generated images have higher diversity than the received sample.
 11. The system of claim 10, wherein the receiving, determining a discriminator loss, determining a plurality of secondary losses, and updating the conditional generator model are performed iteratively.
 12. The system of claim 11, wherein the one or more processors are configured to determine the secondary loss for a first iteration using a first secondary loss model and determining the secondary loss for a second iteration is performed using a different second secondary loss model.
 13. The system claim 10, wherein the sample comprises an associated label and wherein the multi-class classification model is trained to classify the sample into one of a plurality of classes.
 14. The system of claim 13, wherein the classification model is a pre-trained model that is not modified during the training of the conditional generator model.
 15. The system of claim 10, wherein the regression model is trained to predict a continuous aspect of the sample.
 16. The system of claim 10, wherein the aggregate is a weighted average of the discriminator loss and the secondary loss.
 17. The system of claim 16, wherein the receiving, determining a discriminator loss, determining a secondary loss, and updating the conditional generator model are performed iteratively, wherein a weight used for calculating the weighted average is different between different iterations.
 18. The system of claim 10, wherein the one or more processors are further configured to: generate a set of outputs using the trained conditional generator model, wherein the set of outputs comprises a set of samples and a set of associated output labels; and train a new model using the set of generated outputs that does not include any samples. 